﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Evoucher.Business.Models;

public partial class admin_vouchers_packages : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
            LoadPackages();
    }

    private void LoadPackages()
    {
        IVoucherRepository repo = new VoucherRepository();
        gvPackages.DataSource = repo.GetPackages();
        gvPackages.DataBind();
    }

     protected void changeColor(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if (e.Row.RowState == DataControlRowState.Alternate)
            {
                e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#FFEB86';");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#eee';");
            }
            else
            {
                e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#FFEB86';");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#fff';");
            }
        }

    }
}